import http from '@/http/http'
import { AddReplyModel, ReplyListParam, ReplyParam } from './ReplyModel'

enum Api {
    getReplyList = '/api/v1/reply/getList',
    getSort = '/api/v1/reply/getSort',
    addAndEditAndDel = '/api/v1/reply/reply',
    getSelectReplyGroupList = '/api/v1/reply/getSelectReplyGroupList'
}

// 获取自动回复列表
export const getReplyTableApi = async (param: ReplyListParam) => {
    return await http.get(Api.getReplyList, param)
}

// 获得自动回复sort最大值
export const getReplySortApi = async () => {
    return await http.getRestApi(Api.getSort)
}

// 获取分组数据
export const getSelectReplyGroupListApi = async () => {
    return await http.get(Api.getSelectReplyGroupList)
}

// 新增
export const addReplyApi = async (param: AddReplyModel) => {
    return await http.post(Api.addAndEditAndDel, param)
}
// 编辑
export const editReplyApi = async (param: AddReplyModel) => {
    return await http.put(Api.addAndEditAndDel, param)
}
// 删除
export const delReplyApi = async (param: ReplyParam) => {
    return await http.delete(Api.addAndEditAndDel, param)
}
